/*
 * @(#)QueryUtil.java
 * 
 * Copyright (c) 2003 DCIVision Ltd
 * All rights reserved.
 * 
 * This software is the confidential and proprietary information of DCIVision
 * Ltd ("Confidential Information").  You shall not disclose such Confidential
 * Information and shall use it only in accordance with the terms of the license
 * agreement you entered into with DCIVision Ltd.
 */
package com.dcivision.framework.dao;

public class QueryUtil {

    public static Query createQuery() {
        Query query = new Query();
        return query;
    }
    
    public static SubQuery createSubQuery(){
      SubQuery query = new SubQuery();
      return query;
    }
    
    //--Check if the count of Parameter is Right------ for test----
    public static String checkPara(AbstractQuery query){
      StringBuffer s = new StringBuffer(query.toString());
      int i=0;
       while(s.indexOf("?")>-1){
        i++;
        s.deleteCharAt(s.indexOf("?")); 
       }
       if(query.getAllParameters().size()==i)
         return "TRUE";
       else
         return "FALSE";
    }
    
}